check return value of gtk_widget_translate_coordinates() so we cannot end
authorKristian Rietveld <kris@imendio.com>
Wed, 14 Feb 2007 20:38:02 +0000 (20:38 +0000)
committerKristian Rietveld <kristian@src.gnome.org>
Wed, 14 Feb 2007 20:38:02 +0000 (20:38 +0000)
2007-02-14  Kristian Rietveld  <kris@imendio.com>

* gtk/gtktooltip.c (child_location_foreach): check return value
of gtk_widget_translate_coordinates() so we cannot end up
using uninitialized x, y values.  (#407863, patch from Carlos
Garnacho).

svn path=/trunk/; revision=17293

ChangeLog
gtk/gtktooltip.c

index b76671efd5ee37393b7274fec39a12353e8f4dd2..3cb18e9a1e5bcc4aeb379fed6db2c0b51e11ba1c 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2007-02-14  Kristian Rietveld  <kris@imendio.com>
+
+       * gtk/gtktooltip.c (child_location_foreach): check return value
+       of gtk_widget_translate_coordinates() so we cannot end up
+       using uninitialized x, y values.  (#407863, patch from Carlos
+       Garnacho).
+
 2007-02-14  Kristian Rietveld  <kris@imendio.com>
 
        * gtk/gtktreeviewcolumn.c (_gtk_tree_view_column_realize_button):
index 47d08f52046b830d6b1b0af8b7ae649a0f9d3cfb..a00104572859667e057b1078122a854576a047df 100644 (file)
@@ -390,16 +390,14 @@ static void
 child_location_foreach (GtkWidget *child,
                        gpointer   data)
 {
+  gint x, y;
   struct ChildLocation *child_loc = data;
 
-  if (!child_loc->child)
-    {
-      gint x, y;
-
+  if (!child_loc->child &&
       gtk_widget_translate_coordinates (child_loc->container, child,
                                        child_loc->x, child_loc->y,
-                                       &x, &y);
-
+                                       &x, &y))
+    {
       if (x >= 0 && x < child->allocation.width
          && y >= 0 && y < child->allocation.height)
         {